package com.acheli.registry.entity.model;

import com.acheli.registry.block.ACHBlocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.client.model.obj.ObjLoader;
import net.minecraftforge.client.model.obj.ObjModel;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import software.bernie.geckolib.cache.GeckoLibCache;

import static com.acheli.ACHeli.MODID;


public class OBJModelRegistry {
    public static final DeferredRegister<Item> OBJModelItems = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
    public static final DeferredRegister<Block> OBJModelBlocks = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
    public static RegistryObject<Item> factoryRegister(String name) {
        RegistryObject<Block> blockRegistryObject = OBJModelBlocks.register(name, () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.STONE)));
        return OBJModelItems.register(name, () -> new BlockItem(blockRegistryObject.get(), new Item.Properties()));
    }
    public static void register(IEventBus modEventBus) {
        OBJModelBlocks.register(modEventBus);
        OBJModelItems.register(modEventBus);
    }


//    下面注入obj模型

    public static RegistryObject<Item> uh_1d_body = OBJModelRegistry.factoryRegister("uh_1d_body");
    public static RegistryObject<Item> uh_1d_main_propeller = OBJModelRegistry.factoryRegister("uh_1d_main_propeller");
    public static RegistryObject<Item> uh_1d_tiny_propeller = OBJModelRegistry.factoryRegister("uh_1d_tiny_propeller");

}
